/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package scm.rawMaterialPurchasing.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;

/**
 *
 * @author ReinforceII
 */
@Entity
public class RawMaterialRequirementEntity implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    @OneToMany(cascade = {CascadeType.ALL})
    private List<RawMaterialRequirementLineItemEntity> rawMaterialRequirementLineItems;
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date dateGenerated;
    
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date forWeekStartingOn;
    private boolean purchasingOrderGenerated = false;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RawMaterialRequirementEntity)) {
            return false;
        }
        RawMaterialRequirementEntity other = (RawMaterialRequirementEntity) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "scm.rawMaterialPurchasing.entity.RawMaterialRequirementEntity[ id=" + id + " ]";
    }

    /**
     * @return the rawMaterialRequirementLineItems
     */
    public List<RawMaterialRequirementLineItemEntity> getRawMaterialRequirementLineItems() {
        return rawMaterialRequirementLineItems;
    }

    /**
     * @param rawMaterialRequirementLineItems the rawMaterialRequirementLineItems to set
     */
    public void setRawMaterialRequirementLineItems(List<RawMaterialRequirementLineItemEntity> RawMaterialRequirementLineItems) {
        this.rawMaterialRequirementLineItems = RawMaterialRequirementLineItems;
    }

    /**
     * @return the dateGenerated
     */
    public Date getDateGenerated() {
        return dateGenerated;
    }

    /**
     * @param dateGenerated the dateGenerated to set
     */
    public void setDateGenerated(Date date) {
        this.dateGenerated = date;
    }

    /**
     * @return the purchasingOrderGenerated
     */
    public boolean isPurchasingOrderGenerated() {
        return purchasingOrderGenerated;
    }

    /**
     * @param purchasingOrderGenerated the purchasingOrderGenerated to set
     */
    public void setPurchasingOrderGenerated(boolean purchasingOrderGenerated) {
        this.purchasingOrderGenerated = purchasingOrderGenerated;
    }

    /**
     * @return the forWeekStartingOn
     */
    public Date getForWeekStartingOn() {
        return forWeekStartingOn;
    }

    /**
     * @param forWeekStartingOn the forWeekStartingOn to set
     */
    public void setForWeekStartingOn(Date forWeekStartingOn) {
        this.forWeekStartingOn = forWeekStartingOn;
    }
}
